package com.example.excelapp.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.NumberFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.example.excelapp.converter.LocalDateConverter;
import lombok.Data;

import java.time.LocalDate;

@Data
@ColumnWidth(20)
public class UserData {

    @ExcelProperty("用户名")
    private String username;

    @ExcelProperty("年龄")
    @NumberFormat("#")
    private Integer age;

    @ExcelProperty("工资")
    @NumberFormat("#,##0.00")
    private Double salary;

    @ExcelProperty(value = "出生日期", converter = LocalDateConverter.class)
    private LocalDate birthDate;

    @ExcelIgnore
    private String passwordHash;
}

